At 21:52 +0200 on 22/10/1999, Zot O'Connor wrote:
> Is there a function to return the week of the year (0-51)?
Seems you only need to divide the day of the year by seven to reach that,
don't you?
Maybe you should try:
CREATE FUNCTION week( datetime ) RETURNS int4 AS ' SELECT int( date_part( ''day'', $1 - date_trunc( ''year'', $1 ) ) )
/7
' LANGUAGE 'sql';
Herouth
--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma